package com.zhiyou100.service.impl;

import com.zhiyou100.entity.Worker;
import com.zhiyou100.mapper.WorkerMapper;
import com.zhiyou100.service.WorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * worker 接口实现类
 *
 * @author yang
 * @version 1.0.0
 * @date 2020-08-27 20:27
 */

@Service
public class WorkerImpl implements WorkerService {
    private WorkerMapper workerMapper;

    @Autowired
    public void setWorkerMapper(WorkerMapper workerMapper) {
        this.workerMapper = workerMapper;
    }

    @Override
    public Worker selectOneByIdAndPwd(String id, String pwd) {
        return workerMapper.selectWorker(id, pwd);
    }

    @Override
    public List<Worker> list() {
        return workerMapper.list();
    }

    @Override
    public Worker selectOne(Integer wid) {
        return workerMapper.selectOne(wid);
    }

    @Override
    public void updateOne(Worker worker) {
        workerMapper.updateOne(worker);
    }

    @Override
    public void deleteOne(Integer wid) {
        workerMapper.deleteOne(wid);
    }

    @Override
    public void insertOne(Worker worker) {
        workerMapper.insertOne(worker);
    }
}
